In order to have a computer system executable under different environments dependent on OS, various technologies have been proposed to realize easier development and transportation.
As an example of such technology, an official gazette of the Japanese Published Unexamined Patent Application No. HEI 8-63363 discloses a “Virtual Execution Environment System”.
This virtual execution environment system will be explained below with reference to FIG. 1.
A body of program 11 and replacement programs 12a and 12b are provided as the source codes of application software generated by a user (programmer).
The body of program is a source code which is different depending on the object of application software, while the replacement program 12a or 12b replaces an item of information described in the body of program 11 to an adequate item of information corresponding to an apparatus type of existing operating system 60a or 60b, respectively, to realize the virtual execution environment.
For execution by the operating system 60a or 60b, replacement information described in the body of program 11 and replacement program 12a or 12b is converted to an executable program 30a or 30b by utilizing a compiler for the existing operating system and thereafter such executable program is executed with an execution part 22a or 22b. A translation part 21a or 21b translates such replacement information to an executable program which may be executed on the virtual execution environment.
In this case, when the source program is to be described in C language, the replacement program 12a or 12b can utilize macro definition which is processed as a preprocessor of the complier.
As explained above, it is possible to operate the executable program 30a or 30b generated for various environments on the existing operating system 60a or 60b without any modification of the body of program 11 of the application software 10.
Next, construction of a computing system based on the existing technique under an execution environment dependent on OS and execution of process with the same computing system will be explained in detail with reference to FIG. 2.
FIG. 2 shows a concept for software development under the execution environment dependent on OS.
The development of an application in C language is assumed here. The common function with C programming language 102 is provided to a part corresponding to the replacement program 12a or 12b in FIG. 1.
A computing system-A 105a and a computing system-B 105b are provided as shown in FIG. 2 and the environment to execute the program is defined as an execution environment-A 104a and an execution environment-B 104b. The execution environment-A 104a is composed of hardware-A 106a and an OS-A 107a for controlling the hardware and intermediating between the application program and hardware.
A body 100 of application is a source code for a user to describe individual applications and the common function 102 is called to receive the offered function from the system. It should be noted here that a user who will describe the application 100 itself is required only to be aware of a common function interface 101 and is free from execution to change the coding depending on individual environment. Therefore, compatibility is maintained in the source level for the application 100 itself.
The common function 102 is provided as a library function for development and the common function interface 101 is disclosed for users. The common function 102 is used as explained above to provide a unified interface independent of the environment to users.
An execution format is generated here by operation of compiling and linking for a source described with a user. In this case, the compiling is executed with a compilerA 108a under the execution in the execution environment-A 104a, while the compiling is executed with a compiler B 108b under the execution in the execution environment-B 104b. 
Moreover, in the same manner, the execution environment program-A 103a is linked with a linker A 109a for execution environment-A. The execution environment program-A 103a is executed in the execution environment-A 104a and the system of the OS-A 107a is called. Such a system call is also executed for the execution environment-B 104b. 
Operation of compiling and linking is also executed for the application body 100 as the source code of a user. In this example, the execution program-A 110a and execution program-B 110b are respectively generated for the execution environment-A 104a and execution environment-B 104b. 
A module obtained by compiling the common function 102, execution environment program-A 103a and execution environment program-B 103b become the programs to be used to be independent on different OSs, OS-A 111a and OS-B 111b, which may be executed respectively in the intrinsic execution environments through the operation of compiling and linking.
Next, operations of the executable program generated as explained above under the execution environment of the computing system will be summarized below.
For example, the execution program-A 110a is executed as follows under the execution environment-A. Namely, the execution program-A 110a calls the program to be used to be independent on different OS-A 111a. This program to be used to be independent on OS-A 111a is a module provided to absorb a difference of OS observed from the application to provide a common interface. The called program to be used to be independent on different OS-A 111a calls a system to realize the function of OS-A 107a and realize the function of the desired OS with the hardware-A 106a. Upon completion of the operation of the hardware-A 106a, the OS-A 107a returns the control to the program to be used to be independent on different OS-A 111a. Finally, the program to be used to be independent on different OS-A 111a returns the control to the execution program-A 110a. 
Similar operations are executed when the execution program-B 110b is executed under the execution environment-B 104b, but since the execution environment-B 104b is provided for the computing system-B, the OS as the precondition and the hardware are different. For example, the hardware-A 106a and hardware-B 106b are different in machine language system, and the execution environment programs-A 103a and B 103b are different in system call for calling the function of the OS.
A common interface 102 transfers a common error code not dependent on different OS 107 to the body of program 11 by calling almost the same OS function from the body of program 11 even when it is loaded on different OS, without giving any modification to the body of program 11. Here, the common error code means the error code not dependent on the environment when it is observed from the application that may be achieved in direct from or by modifying the error code dependent on OS using the program to be used to be independent on different OS.
The OS function can be called and the program can also be described with the common method by defining the specification of the common interface 102 and thereby the body of program 11 can be reused easily for the other application software.
The prior art described above relates to the system for developing and executing application software under different environments of the computing system.
Here, it will be explained with reference to FIG. 3 to FIG. 7 that a problem is generated in the use of an error code during operation in the prior art.
FIG. 3 shows a relationship among data, program code, register and memory or the like in the computing system-A 105a. 
It has already been described that the computing system-A 105a is structured with a hardware-A 106a, an OS-A 107a, a program to be used to be independent on different OS and an execution program-A 110a. 
As shown in FIG. 3, a CPU-A 121a for executing an instruction, a ROM-A 122a and a RAM-A 102a for storing program and data are mounted on the hardware-A 106a. The CPU-A 121a includes a plurality of general registers.
These general registers include, depending on respective application purposes, a register for parameter of function 124 for transferring a parameter described with a user, a register for temporal variable 125 for storing a temporal variable, a register for return value 126 for returning a return value of function with C programming language and a register used by a programmer freely 127 provided for the programmer.
Moreover, the CPU-A 121a includes a stack pointer register 128 indicating an address in the memory area of stack 130 contained in the RAM-A 123a and a program counter register 129 indicating the next address of the instruction being executed of the program stored on the ROM-A 122a or RAM-A 123a. 
In general, when a compiler such as the C programming language assigns a general register of CPU to data or parameter, a register, classified roughly, which is qualified to be used by a user (namely, it is allowed to process in direct the value of register with an assembler) by assuring existence of the value before or after a certain function is called for a user and a general register used on the system can be considered as that explained above. These general registers do not insure, for a user, existence of the value before or after a certain function is called.
Here, the register for parameter of function 124, register for temporal variable 125 and register for return value 126 are used as the registers which do not assure a constant value before and after the time when the desired function with C programming language is called. Moreover, the register used by programmer freely 127, stack pointer register 128 and program counter register 129 are used as the registers to assure a constant value.
The register for parameter of function 124, register for temporal variable 125, register for return value 126, register used by programmer freely 127 and stack pointer register 128 are usually given enough register length enough processing the same value, respectively.
Here, it is assumed that the execution program code-A 131a as the program code of the execution program-A 110a, program code to be used to be independent on different OS-A 132a as the program code of the program to be used to be independent on different OS-A 111a and OS program code-A 133a as the program code of the OS-A 107a are stored on the ROM- A 122a. These program codes are compiled, as shown in FIG. 2, with the compiler-A 108a for the execution environment-A. In order to execute the execution program-A 110a, the instruction words of the execution program code-A 131a are interpreted and executed. Moreover, in the same manner, in order to execute the program to be used to be independent on different OS-A 111a, the instruction words of the program code to be used to be independent on different OS-A 132a are interpreted and executed, while in order to execute the program of OS-A 107a, the OS program code-A 133a is interpreted and executed, respectively.
In addition, a constant area-A 134a is reserved on the ROM-A 122a in view of storing the error code 135a to be dependent on OS in accordance with the function of the OS-A 107a and the common error code 136 provided with the program to be used to be independent on different OS.
Further, as explained above, the stack area 130 is also reserved on the RAM-A 123a. 
For execution of the execution program code-A 131a, the instruction words starting from the start instruction address 137 of execution program and ending at the end instruction address 138 of execution program are interpreted and executed with the CPU-A 121a. In this case, the program counter register 129 designates the storing address of a machine instruction to be operated following the machine instruction operated at present and the stack pointer register 12B designates the desired memory address in the stack area 130 used in current.
The program counter register 129 designates, upon reaching at the entrance of the common interface 102 programmed within the execution program code A 131a, the leading address of the program to be used to be independent on different OS corresponding to the common interface 102 with the instruction of jump 139 for execution from the CPU-A 121a. 
In the same manner, the program counter register 129 designates, upon reaching at the entrance of the system call of OS-A 107a programmed within the program to be used to be independent on different OS-A 132a, the leading address of the OS program code-A 133a corresponding to such system call with the instruction of software interruption or instruction of jump 140 for execution from the CPU-A 121a. 
When the OS program code-A 133a completes execution of predetermined functions, it stores a return value to the register for return value 126 using the error code 135a to be dependent on OS-A 107a in order to transfer the completion of execution to the program to be used to be independent on different OS-A 111a. The error code 135a to be dependent on OS-A 107a is information indicating whether the program of OS-107a terminates normally or not and what failure is generated within the program of OS-107a or within the computing system-A 105a. 
When the return value is stored with the program code-A 133a of OS-A, the program counter register 129 designates a return address 142 to the program code to be used to be independent on different OS-A 132a and transfers control to the program code to be used to be independent on different OS-A 132a by executing an instruction of return 141.
When control is returned to the program code 132a to be used to be independent on different OS-A 132a, the error code 135a to be dependent on OS-A 107a is stored as the return value in the register for return value 126. On the other hand, a certain error code 135a to be dependent on OS-A 107a within the ROM-A 122a is loaded to the register for temporal variable 125 to compare the values stored in the register for return value 126 and the register for temporal variable 125 using an instruction of comparison 144. When the exactly equivalent error code is detected, the common error code 136 corresponding to such exactly equivalent error code is stored, when the control is returned to the execution program code-A 131a, to the register for return value 126 from the program code to be used to be independent on different OS-A 132a and it is then transferred to the execution program-A 110a. If such equivalent error code is not detected, the next error code 135 to be dependent on OS-A 107a is loaded to the register for temporal variable 125 and the instruction of comparison 144 is executed repeatedly. Detection of the equivalent error code explained here means that the common error code which means the same “memory error” is detected when an error code 135a to be dependent on OS-A 107a, for example, means the “memory error”.
Here, it is assumed as the key-point that an error code is used in common in the execution environment-A 104a and execution environment-B 104b and the same error code is transferred to the execution program-A 110a and execution program-B110b. Therefore, the following merits are assured for those who are describing the applications that the error code returned different OS is no longer changed and it is not required to modify coding to be dependent on the different OS.
Here, it should be noted that the error code 135 to be dependent on OS and the common error code 136 are not installed in a certain case within the constant area 134 but in the course of the program code 132 to be used to be independent on different OS depending on the execution development environment 104.
In the prior art explained above, since a layer to be independent on different OS is provided, easier transportation and description of applications can be provided to a user by defining the common error code to be independent on different OS. However, no consideration is taken into account in regard to implementation of the error code.
A reason is that ROM efficiency becomes bad because the common error code 136 is stored within the constant area 134 of ROM-A 122a, execution program code 131 and program code 132 to be used to be independent on different OS. This problem becomes more serious when the common error code 136 is defined with a value which requires larger storage area.
Therefore, it is effective to make the value of the common error code 136 small, but in this case, an additional problem is generated from the point of view of specifications of instruction set of CPU. Such problem will be explained as follows with reference to FIG. 4 to FIG. 7.
FIG. 4 is an explanatory diagram for zero promotion of a general register.
FIG. 5 is an explanatory diagram for a negative value of general register after the zero promotion.
FIG. 6 is an explanatory diagram for sign promotion of a general register.
FIG. 7 is an explanatory diagram for returning a value of general register after the sign promotion to an original value.
As the specifications of instruction set of CPU, it is specified that the zero promotion is first executed or the sign promotion is first executed on the occasion of storing a value which is comparatively smaller than the range of storage to the general register.
When a small value is loaded to the general register as the specification of an instruction set, the zero promotion is executed in some cases as shown in FIG. 4. In this case, the CPU 121α stores, in above example, a constant data which is a small positive value to the lower significant part 161 of the register 125 for return value or the register 125 for temporal variable and executes a job for zero promotion of the higher significant part 162 with only one instruction.
Moreover, as shown in FIG. 5, a process of the instruction 163 translating to complement on two (2) for zero (0) is necessary for the higher significant part in order to set a negative value to the general register after the zero promotion.
Therefore, in the case where a value of the common error code 136 is defined with a negative code even when a smaller value is set as such common error code 136 and moreover specification of instruction set for loading to the register specifies the zero promotion as explained above, it is required to add the instruction translating to complement on two (2) or the like and thereby the number of instructions in the execution program code-A 131a and program code to be used to be independent on different OS-A 132a increases as much, causing a problem that the ROM efficiency is lowered.
On the other hand, as shown in FIG. 6, the specification of a certain instruction set specifies the sign promotion for loading a small value to the general register. In this case, the CPU 121β stores, in above example, a constant data of a small positive value into the lower significant part 161 of the register for return value 126 or register for temporal variable 125. When a sign bit of small value is 0 (positive), the higher significant part of register is set to 0 and when it is 1 (negative), the higher significant part of register is set to 1. A series of these operations is executed with only one instruction.
FIG. 7 shows the process to return the value of general register after the negative sign promotion to an original value. If it is assumed that the MSB (Most Significant Bit) of the constant data of small value is one (1), a numerical value has different meanings depending on that this constant value data is assumed as the data without sign or as the data with sign.
When the constant value data of small value is the data without sign having the MSB of one (1) and the sign promotion is executed for such data as shown in FIG. 6, one (1) of the higher significant part must be set again to zero (0).
As explained above, when the specification of instruction set for loading to the register specifies the sign promotion as explained above even by making smaller the value of common error code 136 and defining the value of the common error code 136 with the code without sign, it is required to add the instruction 165 for packing 0 to the higher significant part or the like and thereby generating a problem that the number of instructions of the execution program code-A 131a and program code to be used to be independent on different OS-A 132a increases and the ROM efficiency is deteriorated.
The present invention is proposed to solve the problems explained above and it is therefore an object of the present invention to provide a computing system construction method which can improve the ROM efficiency for implementation of the common code without any useless insertion of instructions, while fully utilizing the existing instruction set system on the occasion of returning the error code to the application program which is executed under the environment to be dependent on different OS of the computing system.